import { Random } from 'mockjs'
import moment from 'dayjs'
export default [
  {
    method: 'GET',
    url: '/message/count',
    request: {
    },
    response: {}
  },
  {
    name: '读取文章列表',
    method: 'GET',
    url: '/public/list',
    request: {
    },
    response: {
      'list|1-20': [
        {
          'catalog|+1': ['ask', 'discuss', 'advise', 'share'],
          title: '@ctitle',
          uid: {
            _id: '@guid',
            pic: '@image("200x100", "#50B347", "#FFF", "png", "pic")',
            name: '@cname',
            'isVip|1-7': 1
          },
          snapshot: '@image("200x200", "#894FC4", "#FFF", "png", "snapshot")',
          content: '@csentence(5,20)',
          'answer|5-80': 10,
          created: function () {
            return moment().subtract(Random.natural(1, 10), 'days').format('YYYY-MM-DD HH:mm:ss')
          },
          'tags|+1': [[{ name: '热点' }], [{ name: '精华' }]],
          'reads|10-100': 10,
          'fav|10-200': 10,
          'isTop|+1': ['0', '1'],
          'status|+1': ['0', '1']
        }
      ],
      'total|20-100': 100
    }
  },
  {
    name: '删除帖子',
    method: 'POST',
    url: '/admin/content/delete',
    request: {
    },
    response: {
    }
  },
  {
    name: '修改帖子',
    method: 'GET',
    url: '/admin/content/updateId',
    request: {
    },
    response: {
    }
  },
  {
    name: '修改配置',
    method: 'GET',
    url: '/admin/content/updatePostSettings',
    request: {
    },
    response: {
    }
  },
  {
    name: '获取标签',
    method: 'GET',
    url: '/admin/getTags',
    request: {
    },
    response: {
      'list|20': [
        {
          'tagName|1': ['精华', '热门'],
          'tagClass|1': [
            'layui-bg-gray',
            'layui-bg-red',
            'layui-bg-black',
            'layui-bg-green',
            'layui-bg-cyan',
            'layui-bg-orange',
            'layui-bg-blue'
          ]
        }
      ],
      total: 1
    }
  },
  {
    name: '添加标签',
    method: 'GET',
    url: '/admin/addTag',
    request: {
    },
    response: {
    }
  },
  {
    name: '删除标签',
    method: 'GET',
    url: '/admin/removeTag',
    request: {
    },
    response: {
    }
  },
  {
    name: '修改标签',
    method: 'POST',
    url: '/admin/editTag',
    request: {
    },
    response: {
    }
  }
]
